package com.pdsu.graduation_design.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.pdsu.graduation_design.domain.Type;

import java.util.List;

import q.rorbin.verticaltablayout.adapter.TabAdapter;
import q.rorbin.verticaltablayout.widget.ITabView;
import q.rorbin.verticaltablayout.widget.QTabView;

public class MainMenuBarAdapter implements TabAdapter {



    private List<Type> menus;

    public MainMenuBarAdapter(List<Type> menus) {
        this.menus = menus;
    }

    @Override
    public int getCount() {
        return menus.size();
    }

    @Override
    public ITabView.TabBadge getBadge(int position) {
        return null;
    }

    @Override
    public ITabView.TabIcon getIcon(int position) {
        return null;
    }

    @Override
    public ITabView.TabTitle getTitle(int position) {
        QTabView.TabTitle title = new QTabView.TabTitle.Builder()
                .setContent(menus.get(position).getTypename())//设置数据   也有设置字体颜色的方法
                .build();
        return title;
    }

    @Override
    public int getBackground(int position) {
        return 0;
    }
}
